package Chapter6.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.TableGenerator;

@Entity
public class Sample {
	private long id;
	private String title;

	public Sample(String title) {
		this.title = title;
	}

	public Sample() {
	}

	@Id
	// @SequenceGenerator(name = "seq1", sequenceName = "HIB_SEQ")
	@TableGenerator(name = "tablename", table = "ID_TABLE", pkColumnName = "ID", valueColumnName = "NEXT_ID", initialValue = 3)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "tablename")
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

}
